package com.ego.item.service.impl;

import com.ego.item.mapper.SpecificationMapper;
import com.ego.item.pojo.Specification;
import com.ego.item.service.SpecificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
@Transactional
public class SpecificationServiceImpl implements SpecificationService {

    @Autowired(required = false)
    private SpecificationMapper specificationMapper;

    @Override
    public Specification findSpecificationsByCid(Long id) {
        return specificationMapper.selectByPrimaryKey(id);

    }

    @Override
    public void addSpecification(Specification specification) {
        specificationMapper.insertSelective(specification);
    }

    @Override
    public void updateSpecification(Specification specification) {
        specificationMapper.updateByPrimaryKeySelective(specification);
    }

}
